﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TLCApp
{
    public partial class Rent31 : BaseForm
    {
        public Rent31()
        {
            InitializeComponent();

        }

        private void panel6_Paint(object sender, PaintEventArgs e)
        {

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void textBox8_TextChanged(object sender, EventArgs e)
        {

        }

        private void dataGridView2_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
        {
            ComboBox cb =  e.Control as ComboBox;
            if (cb != null)
            {
                //这里执行绑定 
                //取值的时候取的是dataGridView.Cells[e.RowIndex].FormatValue 
                //dataGridView2.Cells[e.RowIndex].FormatValue 
                //e.CellStyle .Format 
                cb.DropDownStyle = ComboBoxStyle.DropDown ;
                cb.Enter -= new EventHandler(ctl_Enter);
                cb.Enter += new EventHandler(ctl_Enter);
            }
        }
        void ctl_Enter(object sender, EventArgs e)
        {
            (sender as ComboBox).DroppedDown = true;
        }
    }
}
